home *** CD-ROM | disk | FTP | other *** search
/ Suzy B Software 2 / Suzy B Software CD-ROM 2 (1994).iso / prntutil / plot172e / plot172e.txt < prev   
Encoding:
Text File  |  1995-04-25  |  43.7 KB  |  880 lines

  1.                   PLOT - Version 1.72E            June 19, 1992
  2.                   ====================
  3.  
  4.   By:                 
  5.   John Cordes                               
  6.   Department of Physics
  7.   Dalhousie University
  8.   Halifax, N.S.
  9.   Canada B3H 3J5
  10.   Telephone: (902) 494-2313
  11.   email: cordes@ac.dal.ca
  12.  
  13.  
  14.   Copyright John Cordes 1990,1991,1992.  PLOT is freely distributable
  15.   provided this document is distributed with the executable file
  16.   PLOT172E.PRG.
  17.  
  18.          Bug reports, comments or suggestions are welcome.
  19.   **********************************************************************
  20.  
  21.                      Brief  Description of PLOT:
  22.                      ---------------------------
  23.  
  24.   PLOT is a two-dimensional plotting program for the Atari ST which runs
  25.   in high or medium resolution.  Its main features are (1) that it can
  26.   plot a large variety of functions entered at the keyboard, (2) it can
  27.   plot data read from disk files or entered 'by hand' in a built-in data
  28.   editor, and (3) it can produce good quality hardcopy on a variety of
  29.   printers using GDOS printer drivers and fonts.  PLOT was developed in
  30.   GFA Basic, Version 3; it is based on an earlier program I wrote in True
  31.   Basic.  The present version (Plot 1.72E) is compiled in GFA v3.5E.
  32.  
  33.   Any number of curves, in various line and marker styles, may be overlaid
  34.   on a single plot; any combination of individual curves may be saved for
  35.   printer output.
  36.  
  37.   Brief, context sensitive, on-screen help is available at many stages of
  38.   the program at the touch of the <Help> key.  Some, but not all, of the
  39.   information in the help screens will be repeated below; the user is
  40.   urged to read carefully the information in the help screens themselves.
  41.  
  42.   **********************************************************************
  43.  
  44.    ===============  A More Detailed Description of PLOT  ==============
  45.  
  46.     Please note: Additional information may be obtained by scanning the
  47.                  Revision History notes at the end of this file.
  48.  
  49.   When PLOT first starts up you are prompted to make a choice between
  50.   (k)eyboard or (a)rray input. This essentially means: do you want to plot
  51.   a function which you will type in at the keyboard ( keyboard input mode
  52.   option) or plot a set of data points (array input)? In the latter case
  53.   there will be a further prompt: should the data be read from a file, or
  54.   do you want to go directly to the data editor to enter some points?
  55.  
  56.   Another possibility at startup is to hit the F1 function key, which
  57.   takes you to a GEM screen, with a number of drop down menus.  There you
  58.   can do such things as run an external program, set some of PLOT's
  59.   options, check out which GDOS screen and printer fonts are available, or
  60.   call on a set of numerical utilities.
  61.  
  62.   Returning to the command screen (Return to plots, or ^P from the GEM
  63.   screen), where all the real work in PLOT is done, let's suppose you
  64.   choose option (k), keyboard function entry.
  65.  
  66.                       1. Editing Keyboard Entry
  67.      
  68.   When you are being prompted for entry of a function or a numeric
  69.   variable, the normal editing features are (usually) available: <Esc> to
  70.   clear the field, Delete, Backspace and Arrow keys all work; in addition
  71.   <Home> takes you to the beginning of the input string and <Control-Home>
  72.   takes you to the end. <Control-Left Arrow> and <Control-Right Arrow>
  73.   also move the cursor to the beginning and end, respectively, of the
  74.   input field.
  75.  
  76.   When done entering a function (press the Help key at any time for
  77.   guidance on the available functions and other matters), just press
  78.   Return to get to the screen where the Plot Box parameters can be
  79.   entered/modified; you can simply accept Plot's defaults with a single
  80.   press of the Return key. See below (in Section 3: Function Plotting) for
  81.   some examples of possible functions for typing in at the keyboard.
  82.  
  83.                         2.  The Plotting Box
  84.  
  85.   This program doesn't go in for automatic scaling!  The user is always
  86.   prompted at the beginning of plot construction for the range of the
  87.   plotting box (i.e.  xlower, xupper, ylower, yupper) and tick/label
  88.   spacings, etc.  The actual *size* and *location* on screen of the
  89.   plotting box can be set from the alternate (GEM) screen (the box
  90.   coordinates are described in the next paragraph); also the
  91.   presence/absence of the outer frame can be toggled from the menu bar.
  92.  
  93.   If you wish to change the default settings of the size and location of
  94.   the plotting box on the screen, you should be aware that the coordinates
  95.   used are pixels, measured relative to the upper left hand corner of the
  96.   screen.  For the high resolution screen the range is 0 to 639 pixels
  97.   horizontally and 0 to 399 pixels vertically.  For the medium resolution
  98.   screen the range is 0 to 639 horizontally and 0 to 199 vertically.
  99.  
  100.   A brief rundown on the variables you will be prompted for in setting up
  101.   the plotting box:
  102.  
  103.   XLOWER: x-coordinate of left edge of plotting box
  104.  
  105.   XUPPER: x-coordinate of right edge of plotting box
  106.  
  107.   XTICK: spacing of the minor tick marks.  If set to zero the x-axis will
  108.    be omitted entirely.  If xtick < 0, there will be no major or minor
  109.    ticks on the x-axis but there will still be ticks on the surrounding
  110.    frame (which I refer to as the plotting box).
  111.  
  112.   XLABEL: spacing of the major tick marks.  The labels will be placed at
  113.    the major ticks if xlabel > 0.  If xlabel = 0 there will be no major
  114.    ticks or labels anywhere.  If xlabel < 0 there will be no labels but
  115.    major ticks will occur at spacing ABS(xlabel).
  116.  
  117.       ***********   Summary of various tick/label settings  ***********
  118.  
  119.    1.  xtick>0,xlabel>0: Standard case.  Minor ticks at xtick; major
  120.        ticks and labels at xlabel.
  121.    2.  xtick=0,xlabel>0: Omit x-axis.  Major ticks and labels on box.
  122.    3.  xtick<0,xlabel>0: Omits x-axis ticks.  Major/minor ticks/labels
  123.        on box.
  124.    4.  xtick>0,xlabel=0: No labels.  Only (minor) ticks at xtick.
  125.    5.  xtick=0,xlabel=0: No x-axis, no ticks, no labels.
  126.    6.  xtick<0,xlabel=0: No x-axis ticks.  Minor ticks on box; no
  127.        labels.
  128.    7.  xtick>0,xlabel<0: Omits labels; still have x-axis
  129.        major/minor ticks.
  130.    8.  xtick=0,xlabel<0: Omit x-axis.  Major ticks on box, no labels.
  131.    9.  xtick<0,xlabel<0: No x-axis ticks.  Major/minor ticks on box; no
  132.        labels.
  133.  
  134.    Of course, if the plot box (i.e.  the outer frame) is not being drawn
  135.   (it can be toggled on/off in the alternate screen) some of the above
  136.   statements must be modified in a reasonably obvious way.
  137.  
  138.   ********************************************************************
  139.   YLOWER/YUPPER: Similar to xlower/xupper (see above).
  140.   YTICK/YLABEL:  Similar to xtick/xlabel (see above).
  141.  
  142.   GRAIN: This parameter determines the number of function evaluations,
  143.    i.e.  the fineness of the 'mesh'.  The recommended range is (4..2000),
  144.    but the actual lower limit is 1, while the upper limit is constrained
  145.    by the available memory in your machine, at least for screen plotting.
  146.    I have tried grain = 10,000 with no problem.  However, saving a curve
  147.    for printer output is another matter.  At the moment there is a hard
  148.    coded constraint of a little less than 10,000 for the total number of
  149.    function values which can be saved for later GDOS printing; if there
  150.    are arrays involved the x-coordinates need to be stored as well.
  151.  
  152.   LINE STYLE/THICKNESS: The best way to find out about the line styles
  153.    available is to run the program and use the Help key to read help
  154.    screen number 3.  The line thickness should be an odd number in the
  155.    range 1..35.  No harm is done by entering an even number but you won't
  156.    get it!  Also, if the line thickness chosen is anything greater than
  157.    one, the style reverts to the simple solid line (style 1).  Therefore,
  158.    to get one of the styles 2..6 you must enter 1 for the line thickness.
  159.  
  160.    The available line styles are:
  161.        1 = Solid
  162.        2 = Long dash
  163.        3 = Dot
  164.        4 = Dash,dot
  165.        5 = Dash
  166.        6 = Dash,dot,dot.
  167.  
  168.   The negative line styles are used to access the individual point
  169.   plotting mode.  E.g.  entering line style -8 (negative 8) results in a
  170.   small solid box being plotted at each of the mesh points; no connecting
  171.   line is drawn in this case.  See help screen 3 for descriptions of the
  172.   other 7 point styles.
  173.  
  174.    Available marker (point) styles are:
  175.        -1 = Dot (.)
  176.        -2 = Plus (+)
  177.        -3 = Asterisk (*)
  178.        -4 = Square ([])
  179.        -5 = Diagonal Cross (X)
  180.        -6 = Diamond (<>)
  181.        -7 = Solid box
  182.        -8 = Small solid box
  183.  
  184.  
  185.   GRID: This parameter controls whether or not a pattern of grid lines
  186.    will appear on the plot. If set to 1, a mesh of horizontal and
  187.    vertical grid lines will appear at the major tick intervals; if grid
  188.    is set to 0 (the default) no grid lines appear. The line style for the
  189.    grid may also be chosen (styles 1-6).
  190.  
  191.                       3.  Function Plotting
  192.  
  193.   In addition to the standard arithmetic operators +, -, *, /, ^, the
  194.   following functions of the single variable x are supported: SIN, COS,
  195.   TAN, ASIN, ACOS, ATN, EXP, LOG, SQR, SINH, COSH, ABS, SGN, GAMMA, and
  196.   HVS (Heaviside step function: HVS(x) is defined to be equal to 1 for x
  197.   >= 0 and to be 0 for x < 0.).  In addition, two kinds of Bessel
  198.   functions are supported at present: BSJ(a,x) - the Bessel function of
  199.   the first kind (usually called BesselJ(a,x), or J(a,x)) and BSI(a,x) -
  200.   the modified Bessel function I(a,x). The Bessel functions accept real
  201.   constants a (>=0) for the order; however, if the order entered is
  202.   non-integer, x will be restricted to values >=0.  The Airy function,
  203.   AI(x) (x positive or negative), is also supported.
  204.  
  205.   The function parser is not case sensitive - the function names are shown
  206.   in upper case in this document simply for easy visibility.  [See also
  207.   below for the INTEGRATE command].
  208.  
  209.   The maximum allowed length for a function is around 380 characters or
  210.   so.  It's not the parser that's limited to any particular length, but
  211.   rather the limitation comes about from what is then done with the
  212.   function - e.g.  plotting of a very long function is more likely to
  213.   cause a problem (such as error messages, followed by an exit from the
  214.   program, quite possibly) than using the expression evaluator. I have
  215.   successfully plotted functions with 387 characters, and have used longer
  216.   functions in the expression evaluator.
  217.  
  218.   Some effort is made to trap singular behaviour so that, for example, the
  219.   function 1/x can be plotted in a solid line style over a region spanning
  220.   the origin.  Some mathematical liberties are taken in the process, so
  221.   that, for example, if a plot of SQR(x) is requested in the range -5 < x
  222.   < 5, the plot is given properly for positive x but nothing is shown in
  223.   the region where x is negative and the square root doesn't exist (in the
  224.   domain of real numbers).  The lesson here is that in certain cases the
  225.   apparent plotting of a zero value should not necessarily be taken to
  226.   mean that the function is actually zero there!  In addition you should
  227.   be warned that if you try taking a *function* of SQR(x) (such as
  228.   SIN(SQR(x)) or BSJ(1,SQR(x)), say ), with negative values of x being
  229.   required in the plotting range, a fatal error may well occur; the
  230.   program will quite likely quit abruptly and ungracefully exit back to
  231.   the desktop (or shell or whatever). Sorry about that.
  232.  
  233.   Some examples of functions which could be entered at the (k)eyboard
  234.   prompt are:
  235.  
  236.   SIN(pi*x/4) - Ordinary trigonometric function
  237.   BSJ(1,x^2)   - Bessel function J(1,x^2)
  238.   BSJ(.5,x)    - Bessel function of order 1/2
  239.  .5*HVS(3+x)*HVS(3-x) - Draws a sort of 'top hat' function in range (-3,3)
  240.  
  241.  
  242.                        4.  Integration
  243.  
  244.   An additional possibility in function plotting mode is to plot the
  245.   integral of a function, from a specified lower limit to the variable
  246.   upper limit x.  The syntax for this is to enter INTEG(f(x),a) where f(x)
  247.   can be composed of the functions listed above and 'a' is the lower limit
  248.   of the integral.  So for example
  249.  
  250.   INTEG(.5*BSJ(1,x),0) - Integrates (1/2) times the Bessel function
  251.                          J(1,x), with lower limit of integration 0.
  252.  
  253.         x 
  254.        / 
  255.   i.e. | dx [0.5*J(1,x)] will be plotted as a function of x.
  256.        / 
  257.        0
  258.  
  259.  
  260.   SIN(pi*x)*INTEG(BSJ(1,x),0)/COS(x) is also allowed. (Try to avoid
  261.   dividing by a zero value though, since an error will likely occur.)
  262.  
  263.   However, the integration cannot occur as the argument of some other
  264.   function, so:
  265.    
  266.        SIN(INTEG(x,0)) is ILLEGAL.
  267.  
  268.   The rule is simply that there must not be parentheses around the INTEG.
  269.  
  270.   HINT: If a syntax error is reported (e.g.  missing parenthesis or Bessel
  271.   function index not a constant) when entering a function, and you have
  272.   trouble getting rid of the error message no matter how you edit your
  273.   function, try exiting function entry mode (use ESC to clear the edit
  274.   line and enter a backslash '\'), then go into (k)eyboard mode and try
  275.   again.
  276.  
  277.                     5.  Coordinate  Mode
  278.  
  279.   When the function has been plotted the console bell will sound and you
  280.   will see a notice on the screen to the effect that pressing <Esc> will
  281.   take you into coordinate mode.  If you accept this invitation the mouse
  282.   cursor will become a crosshair with which you can read off the (x,y)
  283.   coordinates of any point on the screen.  This feature is especially
  284.   handy for finding zeros of functions, or the x-value at which two curves
  285.   cross.
  286.  
  287.                    Saving the Coordinates:
  288.   After clicking the mouse at a point on the plot, if you press the <s>
  289.   key, a little message will flash on the screen saying 'saved'.  This
  290.   means that the coordinates of that point have been recorded for possible
  291.   later saving in a disk file.  When you exit coordinate mode with another
  292.   <Esc>, if any 'saves' have been made you will be asked if you really
  293.   want to save a file and then be prompted for a disk file name (in an
  294.   item selector box - the default extension .COO doesn't have to be used);
  295.   the file is a simple ascii file with a list of the coordinate pairs
  296.   selected.
  297.  
  298.   If you do not want to enter coordinate mode, just touch another key,
  299.   such as the space bar.  If you exit (or bypass) coordinate mode without
  300.   meaning to you can still press <Esc> later to re-enter coordinate mode.
  301.  
  302.                        6. After Coordinate Mode
  303.  
  304.  (a).  Pressing <Help> gives access to the 9 built-in help screens, as
  305.   usual.
  306.  
  307.  (b).  Pressing <F1> takes you directly to the 'alternate screen'.  This
  308.   is a screen with a standard drop-down menu bar, from which various
  309.   parameters may be set or utilities accessed.  Access to desk accessories
  310.   is also available here.  Under File there are options to save a plot as
  311.   an uncompressed Degas file (.PI3 or .PI2, depending on the resolution),
  312.   or to run an external program.  The printer device number can also be
  313.   altered from the default value (21) in this screen.
  314.  
  315.  (c).  Pressing <L> enters legend mode. Assuming you are running with GDOS
  316.   active, you will be prompted first for the Font ID number to be used.
  317.   This will be, for example, 2 for a Swiss font, 14 for a Dutch font, etc.
  318.   If you don't know the ID numbers for the fonts you have available, don't
  319.   despair! By going to the GEM screen (with the F1 key) and selecting
  320.   Fonts... under the Printer menu heading, PLOT will load the disk-based
  321.   screen and printer fonts available and present a table of those found.
  322.   The screen fonts will have the appropriate Font ID's listed for each
  323.   face; make a note of the ID numbers for future reference. The tables
  324.   will show the point sizes available for each typeface. After specifying
  325.   the typeface to be used by entering a Font ID, next enter the point
  326.   size.  For comparison, the axis labels in PLOT are in Swiss 18 point.
  327.   For best results, try to use a point size for which you have both screen
  328.   and printer fonts available.
  329.  
  330.   You will be prompted to enter some text.  When done press <Return> and
  331.   you will be asked whether the legend, or floating label, should be
  332.   horizontal or vertical.  After answering that query, you can move the
  333.   legend around the screen with the mouse - click with the left button to
  334.   'deposit' the text on the screen at the desired places.  When you have
  335.   finished clicking press <Esc> to 'paste' down your choices, or <Undo> to
  336.   remove all the legends just deposited. Sorry, but there is at the
  337.   present no way to move (or remove) floating labels once they have been
  338.   pasted in place. You may notice that the labels are not always
  339.   immediately re-drawn on the screen after some activity; they will
  340.   (usually!) appear 'soon' and in any case will almost certainly be
  341.   printed. You can press <L> again to add further legends or proceed to
  342.   step (d).
  343.  
  344.   (d).  Pressing <S> is essentially a 'continue' command: you will be
  345.   asked whether you want to save this curve for printing (this assumes
  346.   GDOS is present in the system; if it isn't this prompt will be
  347.   bypassed); assume for now that you answer no.  You will then be asked if
  348.   you want to change the plot parameters (if this is the first curve in
  349.   the plot) or if you want to plot any more curves (if this is not the
  350.   first curve or if you have finished trying new settings for the plot
  351.   parameters (such things as xlower, grain, style, etc.).
  352.  
  353.                           7.  Array  Plotting
  354.  
  355.   Choosing, at startup, option (a) for array plotting presents the user
  356.   with a further choice: reading a data file off disk (f) or using the
  357.   simple built-in data editor (e). Then, either (option (f)) a file
  358.   selector box will appear (default extender ".ASC") for choosing a data
  359.   file, or option (e) lands you in the data editor.
  360.  
  361.   If a data file is read in you will be told the number of points read
  362.   (the maximum number allowed is 2048) and then given the option of
  363.   looking at or modifying the data in the editor, transforming the data in
  364.   various ways, or plotting the data either 'as is' or with fitted curves
  365.   (a linear fit, a polynomial fit (more about this later), a fast cubic
  366.   spline which passes through all the data points, or a smoother (but MUCH
  367.   slower) spline fit which doesn't necessarily pass through the data
  368.   points.  For this latter option (ArrayOp 4) the spline order may be
  369.   input - the allowed values are 1, 2, or 3 (e.g.  this last would mean
  370.   the spline is with cubic curves).  More details on these options may be
  371.   found below.
  372.  
  373.            =============  Data  Files  ====================
  374.  
  375.   The format of the data files is illustrated in the following examples
  376.   (see also the file SAMPLE1.ASC, which should be included in this
  377.   distribution):
  378.  
  379.   ; comment1: this data file might be output from a Fortran program, say.
  380.   ; comment2
  381.   .
  382.   .
  383.   .
  384.   ; commentN
  385.   .27 3.4
  386.   1e-11 4e12
  387.   0 0
  388.   11 -.1
  389.  
  390.   Any number of comment lines may occur at the BEGINNING of the file. The
  391.   *first* character on a comment line must be a semi-colon <;> . After
  392.   this come the x-y coordinate pairs.  The separators may be spaces (any
  393.   number) or a comma; the separator type should not be mixed in a single
  394.   file, however; i.e.  don't use commas for some coordinate pairs and
  395.   spaces only for other pairs.  The following is ok, though:
  396.  
  397.   .27, 3.4
  398.    1,2
  399.     -2.5, 7 
  400.  
  401.    i.e.  when a comma is (consistently) used as the separator there may
  402.    also be leading/trailing spaces on the x and y values.
  403.  
  404.                      Summary of Array Options:
  405.                      =========================
  406.  
  407.  ArrayOp 0: Just pressing <Return> at the Array Ops menu gives this by
  408.   default.  Plots the data points 'as is'.  This allows for using
  409.   individual markers for the data points (use a negative line style) or
  410.   drawing a continuous curve through the points (as in function plotting).
  411.  
  412.  ArrayOp 1: Linear fit - a simple least squares straight line fit.  The
  413.   slope(m) and intercept(b) are shown on the screen with the fitted line.
  414.   There is no way to recover these values once this screen has been left.
  415.   At the moment this option is somewhat superfluous since option 2 (see
  416.   below) can be used with degree set to 1.
  417.  
  418.  ArrayOp 2: Polynomial fit - the user is prompted for the degree of the
  419.   polynomial to be used (this is the exponent of the highest power of x in
  420.   the polynomial).  E.g.  a(1)+a(2)*x+a(3)*x^2 has degree 2, and 3
  421.   coefficients to be determined, so at least 3 data points are required.
  422.   If you enter a degree which is greater than one less than the number of
  423.   data points the program sets degree=Ndatapoints -1.  The fitting is done
  424.   by a singular value decomposition of the 'design' matrix, rather than
  425.   directly solving the so-called normal equations.  This SVD technique is
  426.   slower (and takes a lot more code) than using the normal equations but
  427.   is much more informative and reliable (see, e.g.  Numerical Recipes, by
  428.   Press, Flannery, Teukolsky and Vetterling, p.518 in the Fortran volume).
  429.   After entering the desired degree for the fitting polynomial you will be
  430.   asked for the range of x - values over which the polynomial should be
  431.   drawn (you may only want the fitted curve to be shown in the
  432.   neighbourhood of the data points rather than over the whole range of the
  433.   plotting box).  Then the curve will be plotted.
  434.  
  435.               Viewing the Fitting Parameters and Singular Values
  436.               --------------------------------------------------
  437.  
  438.    After finishing with the coordinate display mode and pressing <S> to
  439.   move on, you will be asked if you want to see the results of the fitting
  440.   routine.  Here you see not only the polynomial coefficients but also the
  441.   singular values of the design matrix.  Some of these may have been set
  442.   to zero by the program because they fall below the limit set by the
  443.   relative error tolerance.  PLOT uses a default tolerance of 1.0E-06;
  444.   this may be modified while you are on the fitting parameters screen by
  445.   pressing <Control-T>.  (The new value will stay in effect until the
  446.   present series of plots is completed unless of course the value is
  447.   edited again.) When you leave the parameters screen the fitting
  448.   parameters and the coefficients are lost, so write them down if you need
  449.   them!  However, the polynomial coefficients can optionally be saved into
  450.   a file before leaving this screen.
  451.  
  452.    The next query is whether anything more is to be done with the data?
  453.   Answer yes if you want to plot the individual points (Option 0), try a
  454.   different fitting routine, use the data editor, etc.
  455.  
  456.   ArrayOp 3: This is a fast cubic spline interpolation through all the
  457.   data points.  PLOT will prompt for xmin and xmax values for drawing the
  458.   resulting curve.
  459.  
  460.   ArrayOp 4: This is a slow spline fit (not just interpolation) to the
  461.   data.  It is so slow that it is probably impractical for data sets with
  462.   more than about 15 - 20 points, say (unless you are very patient!).  The
  463.   order of the spline is input by the user; 3 is a cubic spline (but *not*
  464.   the same as option 3 - try it out and see).
  465.  
  466.             *********************************************************
  467.  
  468.                             8.  Printing
  469.  
  470.   Good quality hard copy is possible if GDOS is present in the machine and
  471.   a suitable printer driver plus font files are available on disk.  The
  472.   default device number for the printer driver (the number used in your
  473.   ASSIGN.SYS file) is 21 - this can be altered with a drop down menu
  474.   selection in the alternate screen; if you *are* going to alter the
  475.   device number I strongly recommend that you do it when starting up PLOT,
  476.   before you forget (the voice of experience speaking...). The program has
  477.   been tested with the 9-pin driver FX80.SYS (on a Citizen 120D), the
  478.   24-pin driver LQ800.SYS (on a Star NX-2400 and an Epson LQ500) and the
  479.   Atari laser printer driver SLM804.SYS (on an SLM804; I haven't tried it
  480.   on an SLM605 but assume it will work).
  481.  
  482.   If GDOS is present, (it, or a replacement, such as G+Plus must have been
  483.   loaded at boot time by being in the AUTO folder), you will be prompted
  484.   at a suitable stage to see if a given curve should be saved for
  485.   printing.  I will elaborate a little on this: You can overlay as many
  486.   curves as you please in a single plot, and any or all curves can be
  487.   tagged for plotting.  This means that the selected curves, together with
  488.   any floating labels/legends which you may have added to the plot via the
  489.   <L> key, will be printed on a single plot, after you have declared that
  490.   no more curves are to be added to the plot.
  491.  
  492.     Warning: saving array plots can be deceptive. The way things are set
  493.     up at the moment, only one curve is saved (the most recent) for each
  494.     data array that is read in. This means that if you want to plot both
  495.     the 'raw' data points and a cubic spline fit, and have both curves
  496.     printed, you must load the data file twice: the first time plot the
  497.     points only (ArrayOp 0) and save the curve for printing, the second
  498.     time plot the cubic spline (ArrayOp 3) and save that curve for
  499.     printing.
  500.  
  501.   You can also save the plot to a file GEMFILE.GEM by 'printing' with
  502.   device number set to 31 (metafile) - the ASSIGN.SYS file must contain
  503.   the metafile driver META.SYS for this to work.  This file can then be
  504.   printed with Migraph's OUTPRINT.PRG; I don't particularly recommend
  505.   trying to do much with the file in EASYDRAW itself, you'll find it's
  506.   pretty 'messy'. 
  507.  
  508.   [If GDOS is NOT present the only reasonable prospects for hardcopy are
  509.   either saving as a Degas picture or doing a screendump with Alt-Help;
  510.   SNAPSHOT.ACC doesn't get along well with PLOT at all.]
  511.  
  512.   At the time when a curve is first selected for printing, PLOT will go to
  513.   disk and look for the printer driver according to the device number
  514.   chosen (default: 21).  This number should match the number given to the
  515.   printer driver in the ASSIGN.SYS file.  If the driver is found PLOT will
  516.   offer some default scaling factors for both the horizontal and vertical
  517.   directions, appropriate to the resolution of the device to which you are
  518.   planning to send the output.  These typically result in a printed plot
  519.   of about 5.5" (horizontal) by 4.5" (vertical) on a 24-pin printer and
  520.   about 4.25" by 3.25" on a 9-pin printer; this assumes that you have not
  521.   altered the default plotting box size for the on-screen display.  Your
  522.   results may vary, however; do some experimenting with the scale factors!
  523.   The printouts look much better on the 24-pin printers (using Migraph's
  524.   printer drivers) than on the 9-pin -- at least, that's been my
  525.   experience.
  526.  
  527.            =============  ASSIGN.SYS files ================
  528.  
  529.   I usually use the same ASSIGN.SYS file used by EASYDRAW.  The actual
  530.   printer driver and font files must be available on disk in the location
  531.   shown in the PATH variable (in the ASSIGN.SYS example file below the
  532.   fonts and driver would be in folder GEMSYS on drive A:).
  533.  
  534.   PATH = A:\GEMSYS\
  535.   ; Change A: to drive with \GEMSYS\ folder
  536.   00p screen.sys
  537.   ; --START OF SCREEN FONTS--
  538.   01p screen.sys
  539.   02p screen.sys
  540.   03p screen.sys
  541.   ; list your medium res screen fonts here.
  542.   04p screen.sys
  543.   ; list your screen fonts for the ST mono screen here.
  544.   ; -- START OF PRINTER FONTS --
  545.   ;21 FX80.SYS     ; Epson 9-pin and compatibles printer driver
  546.   ; SWISS (Sans Serif) 9-pin printer fonts
  547.   ;EPSHSS07.FNT
  548.   ;ATSS10EP.FNT
  549.   ;ATSS12EP.FNT
  550.   ;EPSHSS14.FNT
  551.   ;ATSS18EP.FNT 
  552.   ;ATSS24EP.FNT
  553.   ;EPSHSS28.FNT
  554.   ;EPSHSS36.FNT
  555.   21 LQ800.SYS   ; Epson 24-pin and compatibles printer driver
  556.   ; SWISS  24-pin printer fonts
  557.   P24MSS07.FNT
  558.   ATSS10SP.FNT
  559.   ATSS12SP.FNT
  560.   ATSS18SP.FNT
  561.   ATSS24SP.FNT
  562.   P24MSS36.FNT
  563.   ; METAFILE
  564.   31r META.SYS
  565.  
  566.                              Memory
  567.                              ------
  568.  
  569.   Memory can be a problem in using GDOS and its associated drivers and
  570.   fonts.  When PLOT is first run it displays the free memory remaining -
  571.   this figure must be at least around 330K for the 9-pin or 24-pin drivers
  572.   to work.  If you're close to the limit you may only get a few fonts
  573.   loaded; also I'm not sure what happens if the memory is very tight and
  574.   you try to save several curves for printing on the same plot - one or
  575.   two curves should be alright. I have tried to put in a fair amount of
  576.   intelligent error trapping in case insufficient memory is found, but
  577.   it's always possible you could have a crash.
  578.  
  579.   In some tests with the SLM804 I used a Mega-4 and allocated over 3
  580.   Megabytes for the GDOS stuff (combination of the large printer
  581.   resolution and many fonts in the ASSIGN.SYS file).  1.4 Megabytes or so
  582.   will allow several SLM804 printer fonts (and the SLM driver). The
  583.   minimum memory required to allocate to the laser printer driver itself
  584.   (no fonts) seems to be about 980,000 bytes, though in some tests I've
  585.   seen this go as low as 940,000 bytes.  The additional memory required by
  586.   each font to be loaded corresponds quite well to the size of the font
  587.   file itself.  The order of fonts in your ASSIGN.SYS file is the order in
  588.   which fonts will be loaded (this is true on my system anyway, using
  589.   G+Plus; I don't know if it's universally true), so if there are 2 or 3
  590.   printer fonts you want to be available, list them first. You can use the
  591.   Font display feature of PLOT (function key F8 in the GEM screen) to
  592.   experiment a little with some of this; the information may also be
  593.   useful for operating other GDOS based programs. Be warned that if you
  594.   set the memory to be reserved for the program too low a crash will
  595.   result, requiring a re-set.
  596.   
  597.  **********************************************************************
  598.  
  599.                       Revision History
  600.                       ================
  601.  
  602. 1.72E:
  603.   1. Changed the GDOS printer device detection routine to recognize more
  604.      printers, including the DeskJet 500 (thank you, Vinay).
  605.  
  606.   2. Minor improvements to the data editor window handling, especially
  607.      for cases where the number of data points is 17 (the maximum which
  608.      can be displayed in the window at a time) or a little over.
  609.  
  610.   3. Fixed a recently appearing bug which messed up the invocation of the
  611.      data editor without a data file having being read in.
  612.  
  613. 1.72A:
  614.   1. Corrected a bug in the data file reading routine whereby the last 
  615.      line of data was missed if there was no blank line at the end of
  616.      the file.
  617.  
  618. 1.72:
  619.   1. Grid lines may now be put on the plot.
  620.  
  621.   2. Automatic sorting of data arrays is no longer done. Sorting was added
  622.      in v1.52, but was concealed from the user. As of version 1.72,
  623.      sorting is an option available in the data editor screen by pressing
  624.      the <s> key. This should speed up operations on large arrays which
  625.      don't need sorting. Note that if you insert points (in the data
  626.      editor) out of order, it will be advisable to do a sort before
  627.      leaving the editor if you plan to plot in a continuous line style; if
  628.      you're just going to plot individual points then there's no need to
  629.      do a sort.
  630.  
  631.   3. Keyboard controls have been introduced for scrolling the data editor
  632.      window, to complement the usual mouse operated scroll bar. Up/down
  633.      arrows scroll one line at a time, shift up/down scroll by a
  634.      screenful, and Home/Shift-Home move to the beginning/end of the
  635.      array.
  636.  
  637. 1.71:
  638.   1. Many of the information boxes resulting from menu selections in the
  639.      GEM screen have been re-written as conventional GEM dialog boxes
  640.      (with embedded code, so there's still no .RSC file with PLOT).
  641.  
  642.   2. Legends, or floating labels as they are sometimes called, now make
  643.      use of GDOS screen fonts, if GDOS is active. Any of the typefaces
  644.      and point sizes available may be used. Lists of the (GDOS) screen
  645.      and printer fonts and point sizes available may be viewed under the
  646.      Printer menu heading in the GEM screen (or function key F8).
  647.  
  648. 1.68:
  649.     1. The modified Bessel functions BSI(order,x) now allow a real, not
  650.        just integer, constant for the order.
  651.  
  652.     2. The Airy function, Ai(x), is now built in. It's evaluation is
  653.        expensive, since it is calculated in terms of fractional order
  654.        Bessel functions, which are themselves much more time consuming
  655.        than integer order Bessel functions.
  656.  
  657. 1.66:
  658.     1. Changed GDOS printer driver detection routine to allow a range of
  659.        resolutions for each class of printer; these had previously been
  660.        hardcoded to specific values (e.g. INTOUT(0) = 2399 for the
  661.        SLM804).
  662.  
  663. 1.65:
  664.     1. Fixed bug which caused program to quit if the (d)efault option
  665.        was used at the plot parameters screen.
  666.  
  667.     2. A few changes were made concerning the entry of very long
  668.        functions in keyboard mode. There should now be less chance
  669.        of overflow onto a second line.
  670.  
  671.     3. A problem which sometimes arose in calculating Bessel functions
  672.        of order 2.5 and greater, for x > 25, has been fixed.
  673.  
  674. 1.64a:
  675.     1. The configuration file has been extended to include the functions
  676.        in the history buffer, as well as the GDOS device number. Config
  677.        files can be saved (^G) and loaded (Alt-G) at the alternate GEM
  678.        screen. As before, if a config file is called PLOT.CFG and is 
  679.        located in the directory from which PLOT is run, it will be 
  680.        automatically read in at startup.
  681.  
  682. 1.60:
  683.     1. The INTEGration feature has been enhanced by allowing for
  684.       additional functions to appear before and after the integral,
  685.       e.g. it is now permissible to do
  686.  
  687.          sin(x)*integ(x,0)/pi
  688.  
  689.        The integral cannot, however, appear as the argument of a
  690.        function, so there should never be parentheses around
  691.        integ(x,a).
  692.  
  693.     2. The Bessel functions BSJ (Bessel functions of the first kind)
  694.        now accept real constants (not just integer) for their order.
  695.        This enables one to use the root-finding capability in PLOT
  696.        (Alt-Z at the GEM menu bar screen) to find the zeros of
  697.        spherical Bessel functions, since they are the same as the
  698.        zeros of half-integer order J's. The real constant for the
  699.        order must be non-negative, and if the order is indeed
  700.        non-integer, the function BSJ will only return sensible values
  701.        for non-negative x. It should be noted that the Bessel function
  702.        calculation with fractional order is much slower than in the
  703.        case of integer order; I will be attempting to optimize this
  704.        somewhat but am not expecting very significant improvements.
  705.        Technical note:  the integer order Bessel function calculations
  706.        are done using polynomial approximations, but for fractional
  707.        order a backwards recursion calculation is carried out.
  708.  
  709.     3. The saving of functions into the function history buffer can be
  710.        toggled with Alt-F. If one of the previously saved functions is
  711.        called up, using the up- and/or down-arrow keys, any edits to
  712.        that function are automatically saved. This means that even
  713.        when function saving is OFF, the previously saved functions
  714.        always contain the most recently used set of parameters.
  715.      
  716.     4. In the Calculator, or expression evaluating, mode (Alt-C in
  717.        the alternate screen), a feature has been added to make it
  718.        simpler to repeatedly evaluate a function at different values
  719.        of x. Just type a vertical bar (Shift-backslash) right after
  720.        the function and then type the numerical value of x at which
  721.        you want the function evaluated.  For example
  722.             sin(x)|22
  723.        will return the value of sin(22), and the cursor will
  724.        automatically be positioned after the bar, ready for input of
  725.        another value.
  726.      
  727.     5. The small solid box style (style number = -8) has been made
  728.        twice as big, so that printouts on a laser printer would turn
  729.        out better. The problem is that on the SLM804 the default line
  730.        thickness for curves is one, but that is too fine (in most
  731.        cases) on the laser, so I find it better to go to line
  732.        thickness 3. But then the small solid box didn't show up very
  733.        well over the thicker solid line, consequently I've rather
  734.        arbitrarily doubled the size of the small box. The effects of
  735.        this have not been tested on a dot-matrix printer; hope it
  736.        doesn't cause anybody a problem.
  737.  
  738.     6. It was sometimes a nuisance not being able to get back into
  739.        coordinate reading mode, once it had been exited or by-passed.
  740.        It is now possible to just hit <Esc> anytime after coordinate
  741.        mode has been left, or by-passed, until the <S> key has been
  742.        pressed. It's in fact easy now to go repeatedly into and out of
  743.        coordinate mode, whenever you're at the 'bare' plot, i.e. no
  744.        other prompt is requesting input at the time.
  745.  
  746.     7. The GAMMA function (syntax: gamma(x)) has been added. This
  747.        enables the factorials to be accessed, through the relation
  748.        Gamma(n+1)=n!
  749.  
  750.     8. I have begun to explore the possibilities of a config file, to
  751.        at least partially customize the setup of PLOT for a
  752.        particular user. So far all that is possible is to have a one
  753.        line ascii file, PLOT.CFG, containing a single number which is
  754.        the printer device number, for GDOS printing. Since PLOT comes
  755.        with a default device number of 21, some users might wish to
  756.        create a file containing the number 23, for instance, if their
  757.        ASSIGN.SYS file assigns 23 to their printer driver (otherwise
  758.        you have to remember to change the device number in the
  759.        drop-down menu screen). The presence of the file PLOT.CFG will
  760.        be checked for when PLOT is first run (in the directory from
  761.        which PLOT is run) and, if present, will be read.
  762.  
  763. 1.50:
  764.               1. pi (=3.14159...) can be used in function entry,
  765.           though not when you're being prompted for a *constant*.
  766.           Thus, for example, pi/2*cos(pi*x/2) is a legal function
  767.           entry, but xupper=pi/2 is not allowed.
  768.  
  769.               2. A function history buffer is now built in, so that
  770.           (up to 20) previously entered functions can be scrolled
  771.           through with the up/down arrow keys when you're being
  772.           prompted for function entry. (Function saving can be
  773.           toggled in v1.60).
  774.  
  775.               3. A new menu item, Numeric, appears on the alternate
  776.           (GEM) screen. Here you'll find several useful utilities:
  777.  
  778.                  Calculator: An expression evaluator.  Just type in any
  779.             (numerical) expression, such as sin(22), 2.5*bsj(0,pi/2),
  780.             etc.  and the result will be displayed.  If an 'x' appears
  781.             anywhere it will be taken to be 0. (See new stuff for
  782.             v1.60 for an improvement).
  783.  
  784.                  Zeros: Computes zeros for functions entered at the
  785.             keyboard.  e.g.  you could enter the function (at the y:
  786.             prompt) 'x^2-9', or something much more complicated.  You
  787.             will also have to enter the beginning and end of the
  788.             x-interval (x1 and x2) which will be searched, and specify
  789.             if one (option 0) or 'all' (option 1) roots are wanted.
  790.             What does this mean?  Well, if all roots are requested
  791.             (the default case), the grain setting (defaults to 100) is
  792.             used to divide the interval (x1,x2) into sub-intervals and
  793.             any sub-intervals for which the function has opposite sign
  794.             at the two ends will result in a zero being found.  If
  795.             only one zero is requested, the first zero will be located
  796.             (assuming f(x1)*f(x2) < 0).
  797.  
  798.                  Integration: A numerical integration routine, using 20
  799.             point Gaussian quadrature in each panel.  The number of
  800.             panels into which the interval is divided has a default
  801.             value of 1, but can be altered easily.  If more than 10
  802.             panels are set, intermediate (cumulative) results are
  803.             shown after each 10 panel set is completed.  In most
  804.             cases, you'll soon find that accuracy is rarely increased
  805.             by setting more than 1 or at most a few panels.
  806.  
  807.                  Polynomial Roots: Here a polynomial (of degree up to
  808.             size 20) can be entered.  Only univariate (single variable) 
  809.             polynomials are allowed, but the coefficients may be
  810.             complex.  The (possibly complex) roots are then computed
  811.             and displayed.
  812.  
  813.               While in any of these numerical utilities, screen output
  814.           may be paused (usually) by pressing any key (other than
  815.           Escape - see next sentence) (any key resumes).  Pressing
  816.           <Esc> aborts the current operation.  For example, if you
  817.           want to cut short the computation of zeros of some function,
  818.           pressing <Esc> aborts and returns you to the function entry
  819.           line.
  820.  
  821.          Also: Fixed a bug whereby a (c)ontinue after printing
  822.           hardcopy (with GDOS) messed up screen output (some plot size
  823.           parameters needed resetting after the workstation output).
  824.  
  825. 1.42:
  826.           Fixed a small problem where sometimes the user would be
  827.           prompted for curve printing even when no curves had been
  828.           saved for printing.  This only happened after a (c)ontinue
  829.           sequence.
  830.  
  831. 1.41:
  832.           The Help screens (accessible by pressing the <Help> key)
  833.           are now available at the ArrayOps screen.
  834.  
  835.               Changed the default printer device number (for GDOS) to
  836.           21 for the high resolution screen (it used to be set to 23).
  837.           Now 21 is used for both cases: monochrome and colour
  838.           monitors.
  839.  
  840. 1.34:
  841.           Corrected a problem where there was some confusion as to
  842.           whether the data editor should show the transformed or
  843.           untransformed data.  Found that the GFA Interpreter has a
  844.           bug to do with arrays, but things are OK in the compiled
  845.           version.  Same problem occurs with the 3.5E interpreter.
  846.  
  847. 1.33:     Fixed some problems with line thicknesses for the curves
  848.           occasionally interfering with box frame thickness.
  849.  
  850. 1.30:     Changed method of inputting plotting box parameters
  851.           (xlower..yupper, line style, etc.) from the 'line at a time'
  852.           approach to a full screen editing approach.  Now a single
  853.           <Return> accepts all the defaults and gets on with the job.
  854.  
  855. 1.26:     Added save to disk feature for coordinate pairs read off
  856.           the plot.
  857.  
  858. 1.25:     Added save to disk feature for the polynomial fit
  859.           parameters.
  860.  
  861. 1.23:     <t>rim feature added to editor.  This enables a data array
  862.           to be reduced (trimmed) in size.  In the data editor,
  863.           pressing the <t> key puts up a small box in which four
  864.           parameters are set.  These are:
  865.    (1) nstart - the number of the first data point to be retained.
  866.    (2) nstop - the number of the last data point to be retained (with a
  867.        possible exception if lastpoint is set).
  868.    (3) ntrim - the trim spacing.  E.g.  if nstart=2 and ntrim=3, then
  869.        every third point will be retained, starting with the second.
  870.        Thus the points retained in this example are 2,5,8,...  .
  871.    (4) lastpoint - Setting this to 1 forces the last (of the original
  872.        data set) point to be retained; leaving it at the default of 0
  873.        means that the trimmed array will terminate at whatever data pair
  874.        occurs at a value of nstart+(integer)*ntrim which is less than or
  875.        equal to nstop.
  876.      Note that this trimming procedure can be used to delete any
  877.    contiguous blocks of data, by using ntrim=1 and suitable values for
  878.    nstart and nstop.  The deletions occur only in memory, not on disk.
  879.    They cannot be undone, except by reading in the disk file again.
  880.